create

fun VulkanDeviceHandle.Companion.create(options: VulkanDeviceOptions? = null): VulkanDeviceHandle

Creates a Vulkan instance, device, and graphics queue for render sessions.

Attach sessions with the context from VulkanDeviceHandle.getContext(), in place of a device of your own. Without device_uuid or device_luid, it prefers a discrete GPU. The device enables the external memory and semaphore extensions that the GPU offers.

See mln_vulkan_device_create in the C API reference.

Errors:

  • Status.UNSUPPORTED when supportedRenderBackendMask() lacks RenderBackendFlag.VULKAN, or when presentation is true and the Vulkan loader or the GPU can't present.

  • Status.NOT_FOUND when no GPU matches device_uuid and device_luid.

  • Status.NATIVE_ERROR when there is no Vulkan loader, no GPU has a graphics queue, or Vulkan can't create the instance or the device.